package com.example.mq.mqchile;

import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: DongGuoZhen
 * @Date: 2024/03/08/14:42
 * @Description: 这个类持有服务器的地址
 * 主要功能:创建出连接Connection对象
 */
public class ConnectionFactory {
    //brokerServer的IP地址
    private String host;
    //brokerServer端口号
    private int port;

    //要访问brokerServer的虚拟主机
    //下面几个属性没有实现
/*    private String VirtualHostName;
    private String userName;
    private String password;*/

    public Connection newConnection() throws IOException {
        Connection connection = new Connection(host,port);
        return connection;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

}
